package com.ghf.dp1.sample;

public class Test {
    public static void main(String[] args) {
        Operation add = new OptAdd();
        add.setNuma(11);
        add.setNumb(22);
        System.out.println(add.result());

        //简单工厂,通过继承进行根据类型进行扩展
        Operation operation = OperationFactory.createOperation("+");
        operation.setNuma(11);
        operation.setNumb(22);
        System.out.println(operation.result());
    }
}
